<template>
  <div>
    <h3>{{ name }}娱乐列表--id---{{ id }}</h3>
    <p>a:{{ a }}--b:{{ b }}</p>
  </div>
</template>

<script>
export default {
  name: "PlayItem",
  props: ["id", "name", "a", "b"],
  mounted() {
    console.log(this, "play");
  },
  //组件内守卫:当组件被进入时执行
  beforeRouteEnter(to, from, next) {
    console.log("组件内进入时守卫");
    next();
  },
  //在当前路由改变，但是该组件被复用时调用(动态路由传参改变时候)
  beforeRouteUpdate(to, from, next) {
    console.log("组件内动态路由更新时守卫");
    next();
  },
  //导航离开该组件的对应路由时调用
  beforeRouteLeave(to, from, next) {
    console.log("组件离开时守卫");
    next();
  },
};
</script>

<style></style>
